package core;

public class NetProtocoll {

	/************************************************************/
	/************************ DEFAULT COMMAND *******************/
	/************************************************************/	
	public static String BYE ="BYE";
	public static String ERROR ="ERROR";
	
	/************************************************************/
	/************************ FASE DI LOGIN *********************/
	/************************************************************/
	//LOGIN>userid;password
	public static String LOGIN = "LOGIN>";
	public static String LOGINOK = "LOGINOK";
	public static String LOGINFAILED = "LOGINFAILED";
	
	/************************************************************/
	/******************** INIT DEL CLIENT ***********************/
	/************************************************************/
	public static String STARTINIT = "STARTINIT";
	// INITPROGRAM>programName;extenzion;newFile
	public static String INITPROGRAM = "INITPROGRAM>";
	public static String NEWFILESALLOWED = "YES";
	public static String NEWFILESNOTALLOWED = "NO";
	
	// INITFILE>id;fileName;lastEditBy;lastEditIn;releaseNumber
	public static String INITPROGRAMEND = "INITPROGRAMEND";
	public static String INITFILE = "INITFILE>";
	public static String ENDINIT = "ENDINIT";

	/************************************************************/
	/****************** USERS LIST REFRESHING *******************/
	/************************************************************/
	// RELEASELIST (Client -> Server)
	public static String USERLIST = "USERLIST";
	
	public static String STARTUSERLIST = "STARTUSERLIST"; 
	// RELEASE>userId (Server -> Client)
	public static String USER = "USER>";
	public static String ENDUSERLIST = "ENDUSERLIST"; 
	
	/************************************************************/
	/****************** RELEASE LIST REQUEST ********************/
	/************************************************************/
	// RELEASELIST>fileId (Client -> Server)
	public static String RELEASELIST = "RELEASELIST>";
	
	public static String STARTRELEASELIST = "STARTRELEASELIST"; 	
	// RELEASE>id;addedBy;addedWhen;number;note (Server -> Client)
	public static String RELEASE = "RELEASE>";
	public static String ENDRELEASELIST = "ENDRELEASELIST"; 

	/************************************************************/
	/****************** RELEASE LIST REQUEST ********************/
	/************************************************************/
	//CLIENTLOGGEDIN>userId
	public static String CLIENTLOGGEDIN = "CLIENTLOGGEDIN>";
	//CLIENTLOGGEDOUT>userId
	public static String CLIENTLOGGEDOUT = "CLIENTLOGGEDOUT>";
	
	/************************************************************/
	/****************** FILE TRANSFER SOCKET ********************/
	/************************************************************/
	// USERID>userId
	public static String USERID = "USERID>";
	public static String USERIDOK = "USERIDOK";
	// STARTFILESENDING>programName;fileName;fileSize
	public static String STARTFILESENDING = "STARTFILESENDING>>";
	
	/************************************************************/
	/********************** FILES LOCK **************************/
	/******* Note that this operations doesn't involve dbms *******/
	/************************************************************/
	public static String ADD_LOCK = "ADD_LOCK";
	public static String REM_LOCK = "REM_LOCK";
	// REQUESTFILELOCK>programName;fileName;releaseNumber (-1 lastRelease)
	public static String REQUESTFILELOCK = "REQUESTFILELOCK>";
	public static String FILELOCKOK = "FILELOCKOK";
	public static String FILELOCKFAILED = "FILELOCKFAILED";
	public static String READYTORECEIVE = "READYTORECEIVE";
	// RELEASEFILELOCK>programName;fileName 
	public static String RELEASEFILELOCK = "RELEASEFILELOCK>";
	// LOCKINFO>programName;fileName;[ADD_LOCK | REM_LOCK];userId
	public static String LOCKINFO = "LOCKINFO>";
	
	// COMMITFILE>note
	public static String COMMITFILE = "COMMITFILE>";
	public static String NOCOMMITFILE = "NOCOMMITFILE";
	
	/************************************************************/
	/********************* FILES CREATION ***********************/
	/************************************************************/
	// NEWFILE>programName;fileName
	public static String NEWFILE = "NEWFILE>";
	public static String NEWFILEOK = "NEWFILEOK";
	public static String NEWFILEFAILED = "NEWFILEFAILED";
	
	/************************************************************/
	/********************* CHAT MESSAGES ************************/
	/************************************************************/
	// (Client -> Server) CHAT>receiver;msg
	// (Server -> Client) CHAT>sender;msg
	public static String CHAT = "CHAT>";

}